import http from '@/utils/http'
const top = http;
const inter = {
	//在线充值
	onlinepayPay: '/onlinepay/pay', //充值
	onlinepayPeydetail: '/onlinepay/peydetail', //充值记录
	//住院清单
	daylistQueryprice: '/daylist/queryprice', //通过时间和id查询日消费金额
	//住院充值
	hospitalizationMsg: '/hospitalization/msg', //根据登陆用户的id查询所有住院人的信息
	hospitalizationMsgCard: '/hospitalization/msg/card', //住院充值（住院充值，住院充值记录）------查询住院卡的金额
	hospitalizationMsgRecharge: '/hospitalization/msg/recharge', //住院充值（住院充值记录） 查询住院充值记录
	hospitalizationPay: '/hospitalization/pay', //住院充值
	//根据登录用户id查找绑定的所有就诊人
	patientList: '/patient/list',
	//自助缴费
	selfpayList: '/selfpay/list', //查询就诊人的付费单子
	selfpayPay: '/selfpay/pay', //缴费
	selfpayPaylist: '/selfpay/paylist', //获取门诊缴费记录
	selfpayPaylists: '/selfpay/paylists',
	//就诊指南
	appGuideQueryAll: '/app/guide/queryAll', // 查询业务
	appGuideQueryById: '/app/guide/queryById' //查询业务详细信息
}
export const onlinepayPay = ({
	rechargeMoney,
	userId,
	id,
	payPwd
}) => {
	return top({
		url: `${inter.onlinepayPay}`,
		method: 'post',
		params: {
			rechargeMoney,
			userId,
			id,
			payPwd
		}
	})
}
export const daylistQueryprice = ({
	id,
	dateTime
}) => {
	return top({
		url: `${inter.daylistQueryprice}`,
		params: {
			id,
			dateTime
		}
	})
}
export const onlinepayPeydetail = ({
	id,
	startTime,
	endTime
}) => {
	let data = {
		id
	}
	startTime && (data['startTime'] = startTime);
	endTime && (data['endTime'] = endTime);
	return top({
		url: `${inter.onlinepayPeydetail}`,
		method: 'post',
		params: data
	})
}
export const hospitalizationMsg = ({
	id
}) => {
	return top({
		url: `${inter.hospitalizationMsg}`,
		params: {
			userId: id
		}
	})
}
export const hospitalizationMsgCard = ({
	id
}) => {
	return top({
		url: `${inter.hospitalizationMsgCard}`,
		params: {
			id
		}
	})
}
export const hospitalizationMsgRecharge = ({
	id,
	startTime,
	endTime
}) => {
	let data = {
		id
	}
	startTime && (data['startTime'] = startTime);
	endTime && (data['endTime'] = endTime);
	return top({
		url: `${inter.hospitalizationMsgRecharge}`,
		params: data
	})
}
export const patientList = ({
	id
}) => {
	return top({
		url: `${inter.patientList}`,
		params: {
			id
		}
	})
}
export const selfpayList = ({
	id
}) => {
	return top({
		url: `${inter.selfpayList}`,
		params: {
			id
		}
	})
}
export const selfpayPay = ({
	id,
	appointId,
	orderMoney
}) => {
	return top({
		url: `${inter.selfpayPay}`,
		params: {
			id,
			appointId,
			orderMoney
		}
	})
}
export const selfpayPaylist = ({
	orderId
}) => {
	return top({
		url: `${inter.selfpayPaylist}`,
		params: {
			orderId
		}
	})
}
export const selfpayPaylists = ({
	id,
	startTime,
	endTime
}) => {
	let data = {
		id
	}
	startTime && (data['startTime'] = startTime);
	endTime && (data['endTime'] = endTime);
	return top({
		url: `${inter.selfpayPaylists}`,
		params: data
	})
}
export const hospitalizationPay = ({
	rechargeMoney,
	userId,
	id,
	pwd
}) => {
	return top({
		url: `${inter.hospitalizationPay}`,
		params: {
			money: rechargeMoney,
			userId,
			id,
			pwd
		}
	})
}
export const appGuideQueryAll = () => {
	return top({
		url: `${inter.appGuideQueryAll}`,
		method: 'post'
	})
}
export const appGuideQueryById = (id) => {
	return top({
		url: `${inter.appGuideQueryById}/${id}`,
		method: 'post'
	})
}
